package navigation.wzg.com.navigation.activities;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import navigation.wzg.com.navigation.R;

public class Colorfont extends AppCompatActivity {

    @BindView(R.id.clolerfont_toolber)
    Toolbar clolerfontToolber;
    @BindView(R.id.messagess)
    EditText messagess;
    @BindView(R.id.coloerok)
    Button coloerok;
    @BindView(R.id.coloers)
    EditText coloers;

    String matter;
    String str;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_colorfont);
        ButterKnife.bind(this);
        clolerfontToolber.setTitle("颜色文字");

        Bundle bundle = this.getIntent().getExtras();
        matter = bundle.getString("matter");
    }

    @OnClick(R.id.coloerok)
    public void onViewClicked() {
        String cl = "#"+coloers.getText().toString();
        String ms = messagess.getText().toString();
        str = String.format("%s<font color=\"" + cl + "\">%s",matter,ms);
        Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
        Operation_diary.text.setText(Html.fromHtml(str));
        finish();
    }
}
